<?php

namespace Modules\Car\Entities;

use App\Models\Order;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\SoftDeletes;
use Modules\Manager\Entities\Department;
use Modules\Car\Entities\CarOrder;

class Customer extends Model
{
    use HasFactory,SoftDeletes;

    protected $guarded = [];

    protected function serializeDate(\DateTimeInterface $date)
    {
        return $date->format('Y-m-d H:i:s');
    }
    public function foot(){
        return $this->hasMany(CustomerFoot::class,'openid','openid');
    }
    public function departments(){
        return $this->hasOne(Department::class,'id','department_id');
    }
    public function orders(){
        return $this->hasMany(CarOrder::class,'customer_id','id');
    }
}
